﻿// Write a method that reverses the digits of given decimal number. 
// Example: 256 -> 652

using System;

public class ReverseDecimalDigit
{
    static void Main()
    {
        decimal number = 122000.7m;
        decimal reversedNumber = Reverse(number);
        Console.WriteLine("Number: {0} -> Reversed: {1}", number, reversedNumber);
    }

    public static decimal Reverse(decimal number)
    {
        string numberString = number.ToString();
        char[] digitArray = numberString.ToCharArray();
        Array.Reverse(digitArray);
        string reversedNumberString = new string(digitArray);
        return decimal.Parse(reversedNumberString);
    }
}